#ifndef __WHIMSY_OBJECT_HPP__SHANHAOBO_19800429__
#define __WHIMSY_OBJECT_HPP__SHANHAOBO_19800429__

#include "./WhimsyObjectBase.hpp"
#include "./WhimsyPropertyBase.hpp"
#include "./WhimsyPropertyTraits.hpp"

namespace Whms
{
    namespace Object
    {
        struct Type : public ::Whms::Object::Base::Type
        {
            typedef ::Whms::Property::Type              tProperty;

            typedef tProperty*                          tPropertyPtr;

            typedef ::Wiz::Array::Type<tPropertyPtr>    tPropertyArray;

            virtual ::Whms::Void::Type RegisterProperties()
            {

            }

            template<class PropertyT>
            tPropertyPtr Register(tPropertyArray& IOPropArray, PropertyT const & InProperty)
            {
                typedef typename ::Whms::Property::Traits::Type<PropertyT>::tStd tTraits;

                tTraits* NewPropertyPtr = new tTraits(InProperty);
                if (::Wiz::IsValidPtr(NewPropertyPtr))
                {
                    IOPropArray.PushBack(NewPropertyPtr);
                }

                return NewPropertyPtr;
            }

            tPropertyArray m_Properties;
        };
    } /// end of namespace Object
} /// end of namespace Whms

#endif /*__WHIMSY_OBJECT_HPP__SHANHAOBO_19800429__*/
